package com.distribute.framework.model;

import com.distribute.framework.core.web.helper.Utils;
import java.lang.reflect.Field;
import java.util.Date; 
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;

import javax.annotation.Resource;

import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.core.lang.*; 
import com.distribute.framework.core.web.helper.WebHelper.LzMap;
import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.util.IbatisMap;
import com.distribute.framework.config.*;
import com.distribute.framework.plugin.*;

@namespace("goods/tborderinvoies")
public @caption("订单收益") @database(DatabaseNames.distribute_sys) @source("distribute_sys") @table("tb_order_invoies") class TbOrderInvoies implements java.io.Serializable
{
	private static final long serialVersionUID = 1l;
		
	
		
	private @caption("编号") @column("tboi_id")    @primary  @notnull  @note("  ") Long tboiId;// 主键 非空     
			
 			
 			
 		
	
		
	private @caption("订单编号") @column("tboi_order_number")      @note("  ") String tboiOrderNumber;//     
			
 			
 			
 		
	
		
	private @caption("来源") @column("tboi_source")      @note(" 1:直接购买 2:余额充值 3:代理购买 4:合伙人购买  ") Short tboiSource;// 1:直接购买 2:余额充值 3:代理购买 4:合伙人购买     
			
 			
 			
 		
	
		
	private @caption("所属品牌") @column("tboi_brand")      @relate("$tboiBrand") @RelateClass(Merchant.class)  @note("  ") Long tboiBrand;//     
			
 	private transient Merchant $tboiBrand;//关联对象[品牌信息]
 			
 			
 			
 		
	
		
	private @caption("购买人") @column("tboi_buyer")      @relate("$tboiBuyer") @RelateClass(Member.class)  @note("  ") Long tboiBuyer;//     
			
 	private transient Member $tboiBuyer;//关联对象[会员信息]
 			
 			
 			
 		
	
		
	private @caption("订单总金额") @column("tboi_total")      @note("  ") Double tboiTotal;//     
			
 			
 			
 		
	
		
	private @caption("实际支付金额") @column("tboi_money")      @note("  ") Double tboiMoney;//     
			
 			
 			
 		
	
		
	private @caption("余额抵扣金额") @column("tboi_product")      @note("  ") Double tboiProduct;//     
			
 			
 			
 		
	
		
	private @caption("优惠卷抵扣金额") @column("tboi_coupon")      @note("  ") Double tboiCoupon;//     
			
 			
 			
 		
	
		
	private @caption("平台收益") @column("tboi_pt_sy")      @note("  ") Double tboiPtSy;//     
			
 			
 			
 		
	
		
	private @caption("普通间接收益") @column("tboi_pt_jj")      @note("  ") Double tboiPtJj;//     
			
 			
 			
 		
	
		
	private @caption("普通直接收益") @column("tboi_pt_zj")      @note("  ") Double tboiPtZj;//     
			
 			
 			
 		
	
		
	private @caption("代理间接收益") @column("tboi_dl_jj")      @note("  ") Double tboiDlJj;//     
			
 			
 			
 		
	
		
	private @caption("代理直接收益") @column("tboi_dl_zj")      @note("  ") Double tboiDlZj;//     
			
 			
 			
 		
	
		
	private @caption("合伙人收益") @column("tboi_hhr_sy")      @note("  ") Double tboiHhrSy;//     
			
 			
 			
 		
	
		
	private @caption("配送商收益") @column("tboi_ps_sy")      @note("  ") Double tboiPsSy;//     
			
 			
 			
 		
	
		
	private @caption("经销商收益") @column("tboi_jxs_sy")      @note("  ") Double tboiJxsSy;//     
			
 			
 			
 		
	
		
	private @caption("剩余收益") @column("tboi_sy_sy")      @note("  ") Double tboiSySy;//     
			
 			
 			
 		
	
		
	private @caption("添加时间") @column("tboi_add_time")      @note("  ") Date tboiAddTime;//     
			
 			
 			
 		
	
	 
	//默认构造函数
	public TbOrderInvoies(){ 
	
	}
	
	//主键构造函数
	public TbOrderInvoies(Long id){
		this.tboiId = id;
	}
	
	/**所有字段构造函数 
	 TbOrderInvoies(
	 	Utils.getString("orderNumber")//订单编号
	 	,Utils.getShort("source")//来源
	 	,Utils.getLong("brand")//所属品牌
	 	,Utils.getLong("buyer")//购买人
	 	,Utils.getDouble("total")//订单总金额
	 	,Utils.getDouble("money")//实际支付金额
	 	,Utils.getDouble("product")//余额抵扣金额
	 	,Utils.getDouble("coupon")//优惠卷抵扣金额
	 	,Utils.getDouble("ptSy")//平台收益
	 	,Utils.getDouble("ptJj")//普通间接收益
	 	,Utils.getDouble("ptZj")//普通直接收益
	 	,Utils.getDouble("dlJj")//代理间接收益
	 	,Utils.getDouble("dlZj")//代理直接收益
	 	,Utils.getDouble("hhrSy")//合伙人收益
	 	,Utils.getDouble("psSy")//配送商收益
	 	,Utils.getDouble("jxsSy")//经销商收益
	 	,Utils.getDouble("sySy")//剩余收益
	 	,Utils.getDate("addTime")//添加时间
	 )
	**/
	public TbOrderInvoies(String tboiOrderNumber,Short tboiSource,Long tboiBrand,Long tboiBuyer,Double tboiTotal,Double tboiMoney,Double tboiProduct,Double tboiCoupon,Double tboiPtSy,Double tboiPtJj,Double tboiPtZj,Double tboiDlJj,Double tboiDlZj,Double tboiHhrSy,Double tboiPsSy,Double tboiJxsSy,Double tboiSySy,Date tboiAddTime){
		
			
			
		this.tboiOrderNumber=tboiOrderNumber;
		
			
		this.tboiSource=tboiSource;
		
			
		this.tboiBrand=tboiBrand;
		
			
		this.tboiBuyer=tboiBuyer;
		
			
		this.tboiTotal=tboiTotal;
		
			
		this.tboiMoney=tboiMoney;
		
			
		this.tboiProduct=tboiProduct;
		
			
		this.tboiCoupon=tboiCoupon;
		
			
		this.tboiPtSy=tboiPtSy;
		
			
		this.tboiPtJj=tboiPtJj;
		
			
		this.tboiPtZj=tboiPtZj;
		
			
		this.tboiDlJj=tboiDlJj;
		
			
		this.tboiDlZj=tboiDlZj;
		
			
		this.tboiHhrSy=tboiHhrSy;
		
			
		this.tboiPsSy=tboiPsSy;
		
			
		this.tboiJxsSy=tboiJxsSy;
		
			
		this.tboiSySy=tboiSySy;
		
			
		this.tboiAddTime=tboiAddTime;
		
	}
	
	//设置非空字段
	public TbOrderInvoies setNotNull(){
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		return this;
	}
	
	
		
	/** 编号 [非空]       **/
	public TbOrderInvoies tboiId(Long tboiId){
		this.tboiId = tboiId;
		this.setSeted(F.tboiId);
		return this;
	}
	
		
	/** 订单编号        **/
	public TbOrderInvoies tboiOrderNumber(String tboiOrderNumber){
		this.tboiOrderNumber = tboiOrderNumber;
		this.setSeted(F.tboiOrderNumber);
		return this;
	}
	
		
	/** 来源    1:直接购买 2:余额充值 3:代理购买 4:合伙人购买     **/
	public TbOrderInvoies tboiSource(Short tboiSource){
		this.tboiSource = tboiSource;
		this.setSeted(F.tboiSource);
		return this;
	}
	
		
	/** 所属品牌  [Merchant]      **/
	public TbOrderInvoies tboiBrand(Long tboiBrand){
		this.tboiBrand = tboiBrand;
		this.setSeted(F.tboiBrand);
		return this;
	}
	
		
	/** 购买人  [Member]      **/
	public TbOrderInvoies tboiBuyer(Long tboiBuyer){
		this.tboiBuyer = tboiBuyer;
		this.setSeted(F.tboiBuyer);
		return this;
	}
	
		
	/** 订单总金额        **/
	public TbOrderInvoies tboiTotal(Double tboiTotal){
		this.tboiTotal = tboiTotal;
		this.setSeted(F.tboiTotal);
		return this;
	}
	
		
	/** 实际支付金额        **/
	public TbOrderInvoies tboiMoney(Double tboiMoney){
		this.tboiMoney = tboiMoney;
		this.setSeted(F.tboiMoney);
		return this;
	}
	
		
	/** 余额抵扣金额        **/
	public TbOrderInvoies tboiProduct(Double tboiProduct){
		this.tboiProduct = tboiProduct;
		this.setSeted(F.tboiProduct);
		return this;
	}
	
		
	/** 优惠卷抵扣金额        **/
	public TbOrderInvoies tboiCoupon(Double tboiCoupon){
		this.tboiCoupon = tboiCoupon;
		this.setSeted(F.tboiCoupon);
		return this;
	}
	
		
	/** 平台收益        **/
	public TbOrderInvoies tboiPtSy(Double tboiPtSy){
		this.tboiPtSy = tboiPtSy;
		this.setSeted(F.tboiPtSy);
		return this;
	}
	
		
	/** 普通间接收益        **/
	public TbOrderInvoies tboiPtJj(Double tboiPtJj){
		this.tboiPtJj = tboiPtJj;
		this.setSeted(F.tboiPtJj);
		return this;
	}
	
		
	/** 普通直接收益        **/
	public TbOrderInvoies tboiPtZj(Double tboiPtZj){
		this.tboiPtZj = tboiPtZj;
		this.setSeted(F.tboiPtZj);
		return this;
	}
	
		
	/** 代理间接收益        **/
	public TbOrderInvoies tboiDlJj(Double tboiDlJj){
		this.tboiDlJj = tboiDlJj;
		this.setSeted(F.tboiDlJj);
		return this;
	}
	
		
	/** 代理直接收益        **/
	public TbOrderInvoies tboiDlZj(Double tboiDlZj){
		this.tboiDlZj = tboiDlZj;
		this.setSeted(F.tboiDlZj);
		return this;
	}
	
		
	/** 合伙人收益        **/
	public TbOrderInvoies tboiHhrSy(Double tboiHhrSy){
		this.tboiHhrSy = tboiHhrSy;
		this.setSeted(F.tboiHhrSy);
		return this;
	}
	
		
	/** 配送商收益        **/
	public TbOrderInvoies tboiPsSy(Double tboiPsSy){
		this.tboiPsSy = tboiPsSy;
		this.setSeted(F.tboiPsSy);
		return this;
	}
	
		
	/** 经销商收益        **/
	public TbOrderInvoies tboiJxsSy(Double tboiJxsSy){
		this.tboiJxsSy = tboiJxsSy;
		this.setSeted(F.tboiJxsSy);
		return this;
	}
	
		
	/** 剩余收益        **/
	public TbOrderInvoies tboiSySy(Double tboiSySy){
		this.tboiSySy = tboiSySy;
		this.setSeted(F.tboiSySy);
		return this;
	}
	
		
	/** 添加时间        **/
	public TbOrderInvoies tboiAddTime(Date tboiAddTime){
		this.tboiAddTime = tboiAddTime;
		this.setSeted(F.tboiAddTime);
		return this;
	}
	
	
	
	/**
	* 克隆对象
	**/
	public TbOrderInvoies clone(){
		TbOrderInvoies clone = new TbOrderInvoies();
		
			
			
		clone.tboiOrderNumber=this.tboiOrderNumber;
		
			
		clone.tboiSource=this.tboiSource;
		
			
		clone.tboiBrand=this.tboiBrand;
		
			
		clone.tboiBuyer=this.tboiBuyer;
		
			
		clone.tboiTotal=this.tboiTotal;
		
			
		clone.tboiMoney=this.tboiMoney;
		
			
		clone.tboiProduct=this.tboiProduct;
		
			
		clone.tboiCoupon=this.tboiCoupon;
		
			
		clone.tboiPtSy=this.tboiPtSy;
		
			
		clone.tboiPtJj=this.tboiPtJj;
		
			
		clone.tboiPtZj=this.tboiPtZj;
		
			
		clone.tboiDlJj=this.tboiDlJj;
		
			
		clone.tboiDlZj=this.tboiDlZj;
		
			
		clone.tboiHhrSy=this.tboiHhrSy;
		
			
		clone.tboiPsSy=this.tboiPsSy;
		
			
		clone.tboiJxsSy=this.tboiJxsSy;
		
			
		clone.tboiSySy=this.tboiSySy;
		
			
		clone.tboiAddTime=this.tboiAddTime;
		
		return clone;
	}
	
	
	
	
	
	/**
	 * 根据ID取订单收益
	 * @param id
	 * @return
	 */
	public static @api TbOrderInvoies get(Long id){		
		return getTbOrderInvoiesById(id);
	}
	
	
	/**
	 * 设置ID
	 * @param id
	 * @return
	 */
	public void setId(Long id){		
		this.tboiId = id;
	}
	
	
	/**
	 * 获取所有订单收益
	 * @return
	 */
	public static @api List<TbOrderInvoies> list(Map params,Integer size){
		return getTbOrderInvoiesList(params,size);
	}
	/**
	 * 获取订单收益分页
	 * @return
	 */
	public static @api Page<TbOrderInvoies> page(Integer page,Integer size,Map params){
		return getTbOrderInvoiesPage(page, size , params);
	}
	
	
	/**
	 * 根据查询条件取订单收益
	 * @param params
	 * @return
	 */
	public static @api TbOrderInvoies Get(Map params){
		return getTbOrderInvoies(params);
	}
	/**
	 * 获取订单收益数
	 * @return
	 */
	public static @api Long count(Map params){
		return getTbOrderInvoiesCount(params);
	}
	/**
	 * 获取订单收益数
	 * @return
	 */
	public static @api <T> T eval(String eval,Map params){
		return getTbOrderInvoiesEval(eval,params);
	}
	
	
	/**
	 * 获取订单收益图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey){
		return getTbOrderInvoiesStats(params,sumKey,groupKey,-1);
	}
	/**
	 * 获取订单收益图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey,int dateType){
		return getTbOrderInvoiesStats(params,sumKey,groupKey,dateType);
	}
	
	
	/**
	 * 根据ID取订单收益
	 * @param id
	 * @return
	 */
	public static @api TbOrderInvoies getTbOrderInvoiesById(Long id){		
		return getTbOrderInvoiesDao().getTbOrderInvoiesById(id);
	}
	
	
	/**
	 * 获取id
	 * @return
	 */
	public Long getId(){
		return this.tboiId;
	}
	
	
	
	/**
	 * 根据ID取订单收益的标识键值
	 * @param id
	 * @return
	 */
	public static @api String getKeyValue(Object key){
		Long id = Utils.parseLong(key);	
		if(id==null || id.longValue()==0 ){
			
			return null;
			
		}
		String value = null;
		
		value = Cache.getValue(TbOrderInvoies.class, id);
				
		if(value==null){
			TbOrderInvoies tbOrderInvoies = get(id);
			if(tbOrderInvoies!=null){
				String strValue = tbOrderInvoies.getTboiId$();
				
				
				Cache.setValue(TbOrderInvoies.class, id ,strValue);
				
				value = strValue;
			}else{
				
				Cache.setValue(TbOrderInvoies.class, id ,"{"+id+"}",30);
				
				value = "{"+id+"}";
			}
		}
		
		/************LAZY3Q_ID_KEYVALUE************/
		/************LAZY3Q_ID_KEYVALUE************/
		return value;
	}	
	
	
	/**
	 * 获取当前对象的键值
	 * @return
	 */
	public String getKeyValue(){
		
		/************LAZY3Q_CODE_KEYVALUE************/
		/************LAZY3Q_CODE_KEYVALUE************/
		String keyValue = this.getTboiId$();
		
		return keyValue;
	}
	
	
	/**
	 * 根据关键字精确查询订单收益对象
	 * @return
	 */
	public static @api TbOrderInvoies find(String key){
		if(Utils.empty(key))return null;
		Map params = new HashMap();
		if(key.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
			params.put("tboiId", key.toLowerCase().replaceFirst("id:", ""));					
		else{//按标识查询，精确查询
			String strDefinex = "";
			
			strDefinex="(2=1 "+strDefinex+")";
			params.put("definex",strDefinex);
		}
		
		/************LAZY3Q_CODE_FIND************/
		/************LAZY3Q_CODE_FIND************/
		return TbOrderInvoies.getTbOrderInvoies(params);
	}
	
	
	/**
	 * 根据关键字查询订单收益
	 * @return
	 */
	public static @api List<Map> query(String key,int size,Map params,Boolean bObject){
		if(Utils.empty((String)params.get("asc")) && Utils.empty((String)params.get("desc")))//如果未传入排序字段
			params.put("desc","tboi_id");//那么，默认以主键降序，传给Dao层
		String strTerm=key;		
		if(!Utils.empty(strTerm)){
			if(strTerm.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
				params.put("tboiId", strTerm.toLowerCase().replaceFirst("id:", ""));					
			else//按标识查询，模糊查询请带%
			{
				String strDefinex = "";
				
				strDefinex="(2=1 "+strDefinex+")";
				params.put("definex",strDefinex);
			}
		}
		
		
		/************LAZY3Q_CODE_QUERY************/
		/************LAZY3Q_CODE_QUERY************/
			
		List<TbOrderInvoies> list = page(0,size,params).getResult();
		
		/**
		* OK!取到数据拼成放入Map中，[{value,text,object:{...}},...]
		* value:数据ID，text:数据标识,object,整个对象
		**/
		List<Map> result = new java.util.ArrayList();
		for(TbOrderInvoies tbOrderInvoies:list){
			Map map = new HashMap();
			map.put("key",tbOrderInvoies.getTboiId().toString());
			map.put("value", Utils.js(tbOrderInvoies.getKeyValue()));
			if(bObject==true)
				map.put("object",tbOrderInvoies);
			result.add(map);
		}
		
		
		/************LAZY3Q_AFTER_QUERY************/
		/************LAZY3Q_AFTER_QUERY************/
		
		return result;
	}
	
	
	
	/**
	 * 获取所有订单收益
	 * @return
	 */
	public static @api List<TbOrderInvoies> getTbOrderInvoiesList(Map params,Integer size){
		return getTbOrderInvoiesDao().getTbOrderInvoiesList(params,0,size);
	}
	
	/**
	 * 获取订单收益分页
	 * @return
	 */
	public static @api Page<TbOrderInvoies> getTbOrderInvoiesPage(Integer page,Integer size,Map params){
		if(page==null)page=0;
		if(size==null)size=20;
		return getTbOrderInvoiesDao().getTbOrderInvoiesPage(page, size , params);
	}
	
	/**
	 * 根据查询条件取订单收益
	 * @param params
	 * @return
	 */
	public static @api TbOrderInvoies getTbOrderInvoies(Map params){
		return getTbOrderInvoiesDao().getTbOrderInvoies(params);
	}
	
	/**
	 * 保存一个订单收益
	 * @param tbOrderInvoies
	 * @return
	 */
	public static @api TbOrderInvoies saveTbOrderInvoies(TbOrderInvoies tbOrderInvoies){
		return getTbOrderInvoiesDao().saveTbOrderInvoies(tbOrderInvoies);
	}
	
	/**
	 * 根据条件更新订单收益
	 * @param values
	 * @param params
	 */
	public static @api int updateTbOrderInvoiesByConfirm(Map values, Map params){
		return getTbOrderInvoiesDao().updateTbOrderInvoiesByConfirm(values,params);
	}
	
	/**
	 * 修改一个订单收益
	 * @param tbOrderInvoies
	 * @return
	 */
	public static @api int updateTbOrderInvoies(TbOrderInvoies tbOrderInvoies){
		return getTbOrderInvoiesDao().updateTbOrderInvoies(tbOrderInvoies);
	}
	
	/**
	 * 更新订单收益非空字段
	 * @param tbOrderInvoies
	 */
	public static @api int updateTbOrderInvoies$NotNull(TbOrderInvoies tbOrderInvoies){
		return getTbOrderInvoiesDao().updateTbOrderInvoies$NotNull(tbOrderInvoies);
	}
	
	/**
	 * 获取订单收益数
	 * @return
	 */
	public static @api Long getTbOrderInvoiesCount(Map params){
		return getTbOrderInvoiesDao().getTbOrderInvoiesCount(params);
	}
		
		
	/**
	 * 获取订单收益自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public static @api <T> T getTbOrderInvoiesEval(String eval,Map params){
		return getTbOrderInvoiesDao().getTbOrderInvoiesEval(eval,params);
	}
	
	
	/**
	 * 获取订单收益图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> getTbOrderInvoiesStats(Map params,C sumKey,C groupKey,int dateType){
		//TODO:图表统计功能未实现
		
		Map<String,Object> groups=new HashMap();//要分组的字段
		Map<String,Object> sums=new HashMap();//要统计的字段
		
		String[][] dateFormats=new String[][]{
				null,
				new String[]{"%Y","yyyy年","Y"},
				new String[]{"%Y-%m","yyyy年MM月","M"},
				new String[]{"%Y%U","yyyy年第ww周","W"},
				new String[]{"%Y-%m-%d","yyyy年MM月dd日","D"},
				new String[]{"%Y-%m-%d %H","yyyy年MM月dd日 HH点","H"},
				new String[]{"%m","MM月"},
				new String[]{"%d","dd号"},
				new String[]{"%H","HH点"} 
		};
		
		//获取要分组的字段，放入Map中
		if(dateType>0){
			groups.put(groupKey.toString(),"DATE_FORMAT({key},'"+dateFormats[dateType][0]+"')");
		}else{
			groups.put(groupKey.toString(),"{key}");
		}
		if(dateType<6 && dateType>0){ 
			params.put("asc", groupKey.toString()); 
			if(params.get(groupKey.name()+"Start")==null){
				params.put(groupKey.name()+"Start", Utils.date(new Date(), -24, dateFormats[dateType][2]));
			}
		}
		
		
		//获取要统计的字段，放入Map中
		if(sumKey.toString().equals("count")){
			sums.put(sumKey.toString(),"count(*)");
		}else{
			sums.put(sumKey.toString(),"sum({key})");
		}
		
		List<Map> list = getTbOrderInvoiesDao().getTbOrderInvoiesStats(params,groups,sums);
		
		List<Map> result = new ArrayList();
		for(Map m:list){
			Map map = new HashMap();
			Object value = m.get(sumKey.toString());
			Object name = null;
			Object groupValue = m.get(groupKey.toString());
			if(dateType>0){
				name = Utils.date(Utils.parseDate(groupValue), dateFormats[dateType][1]);
			}else{
				try{
					java.lang.reflect.Method method = TbOrderInvoies.class.getMethod("get"+Utils.ForMat(groupKey.toString())+"$");
					method.setAccessible(true);
					name = method.invoke(TbOrderInvoies.fromMap(m));
				}catch(Exception ex){
					ex.printStackTrace();
				}
			}
			map.put("name", name);
			map.put("value", value);
			result.add(map);
		}
		return result;
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static int updateTbOrderInvoies(Map set,Map where){
		if(set.isEmpty())throw new RuntimeException("set为空");
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		return getTbOrderInvoiesDao().updateTbOrderInvoiesByConfirm(set, where);
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void deleteTbOrderInvoies(Map where){
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		getTbOrderInvoiesDao().deleteTbOrderInvoiesByConfirm(where);
	}
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void delete(Long id){
		if(id==null)throw new RuntimeException("id为空");
		
		getTbOrderInvoiesDao().deleteTbOrderInvoiesById(id);
		
	}
	
	
	/**
	 * 保存订单收益对象
	 * @param params
	 * @return
	 */
	public TbOrderInvoies save(){
		if(this.getTboiId()!=null)
			getTbOrderInvoiesDao().updateTbOrderInvoies(this);
		else
			return getTbOrderInvoiesDao().saveTbOrderInvoies(this);
		return this;
	}
	
	
	/**
	 * 更新订单收益对象的非空字段,注意跟Service里面的update不一样哦
	 * @param params
	 * @return
	 */
	public int update(){
		return getTbOrderInvoiesDao().updateTbOrderInvoies$NotNull(this);
	}
	
	
	/**
	 * 删除
	 * @param params
	 * @return
	 */
	public void delete(){
		
			getTbOrderInvoiesDao().deleteTbOrderInvoiesById(this.getTboiId());
	}
	
	/**
	 * 执行事务
	 * @param function
	 */
	public static <T> T execute(Function function){
		return getTbOrderInvoiesDao().executeTransaction(function);
	}

	
	
	/*******************************编号**********************************/	
	/**
	* 编号 [非空]      
	**/
	public Long getTboiId(){
		
		if(this.tboiId!=null){
			return this.tboiId;
		}
		
		return this.tboiId;
	}
	/**
	* 获取编号格式化(toString)
	**/
	public String getTboiId$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTboiId());
	 
	 	 return strValue;
	}
	/**
	* 根据编号反格式化
	**/
	public void setTboiId$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiId=null;
			return;
		}
	
	
	 	this.tboiId=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 编号 [非空]      
	**/
	public void setTboiId(Long tboiId){
		this.tboiId = tboiId;
		
		this.setSeted(F.tboiId);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************订单编号**********************************/	
	/**
	* 订单编号       
	**/
	public String getTboiOrderNumber(){
		
		if(this.tboiOrderNumber!=null){
			return this.tboiOrderNumber;
		}
		
		return this.tboiOrderNumber;
	}
	/**
	* 获取订单编号格式化(toString)
	**/
	public String getTboiOrderNumber$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTboiOrderNumber());
	 
	 	 return strValue;
	}
	/**
	* 根据订单编号反格式化
	**/
	public void setTboiOrderNumber$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiOrderNumber=null;
			return;
		}
	
	
	 	this.tboiOrderNumber=strValue;
	 
	}
	
	/**
	* 订单编号       
	**/
	public void setTboiOrderNumber(String tboiOrderNumber){
		this.tboiOrderNumber = tboiOrderNumber;
		
		this.setSeted(F.tboiOrderNumber);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************来源**********************************/	
	/**
	* 来源    1:直接购买 2:余额充值 3:代理购买 4:合伙人购买    
	**/
	public Short getTboiSource(){
		
		if(this.tboiSource!=null){
			return this.tboiSource;
		}
		
		return this.tboiSource;
	}
	/**
	* 获取来源格式化(toString)
	**/
	public String getTboiSource$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getTboiSource()),"1"))
			strValue=Utils.string("直接购买");		 
			
		 if(Utils.equals(Utils.string(this.getTboiSource()),"2"))
			strValue=Utils.string("余额充值");		 
			
		 if(Utils.equals(Utils.string(this.getTboiSource()),"3"))
			strValue=Utils.string("代理购买");		 
			
		 if(Utils.equals(Utils.string(this.getTboiSource()),"4"))
			strValue=Utils.string("合伙人购买");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据来源反格式化
	**/
	public void setTboiSource$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiSource=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"直接购买"))
		 	this.tboiSource=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"余额充值"))
		 	this.tboiSource=Utils.parseShort("2");
			
		 if(Utils.equals(strValue,"代理购买"))
		 	this.tboiSource=Utils.parseShort("3");
			
		 if(Utils.equals(strValue,"合伙人购买"))
		 	this.tboiSource=Utils.parseShort("4");
			
		
	 
	}
	
	/**
	* 来源    1:直接购买 2:余额充值 3:代理购买 4:合伙人购买    
	**/
	public void setTboiSource(Short tboiSource){
		this.tboiSource = tboiSource;
		
		this.setSeted(F.tboiSource);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************所属品牌**********************************/	
	/**
	* 所属品牌  [Merchant]     
	**/
	public Long getTboiBrand(){
		
		if(this.tboiBrand!=null){
			return this.tboiBrand;
		}
		
		return this.tboiBrand;
	}
	/**
	* 获取所属品牌格式化(toString)
	**/
	public String getTboiBrand$(){
		String strValue="";
	
	
		 
		if(this.getTboiBrand()!=null){
			
				strValue+=Utils.string(Merchant.getKeyValue(this.getTboiBrand()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据所属品牌反格式化
	**/
	public void setTboiBrand$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiBrand=null;
			return;
		}
	
	
		 
		Merchant item = Merchant.find(strValue);
		if(item!=null){
			
			this.tboiBrand = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 所属品牌  [Merchant]     
	**/
	public void setTboiBrand(Long tboiBrand){
		this.tboiBrand = tboiBrand;
		
		this.setSeted(F.tboiBrand);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[品牌信息]
	**/	 			
 	public Merchant get$tboiBrand(){
 		if(this.$tboiBrand!=null)
 			return this.$tboiBrand;
 		com.distribute.framework.model.Merchant merchant = null;
		if(this.getTboiBrand()!=null){
		
 			merchant = Merchant.get(this.getTboiBrand());
 		
 		}
 		return merchant;
	}
	
 	
	
	
	/*******************************购买人**********************************/	
	/**
	* 购买人  [Member]     
	**/
	public Long getTboiBuyer(){
		
		if(this.tboiBuyer!=null){
			return this.tboiBuyer;
		}
		
		return this.tboiBuyer;
	}
	/**
	* 获取购买人格式化(toString)
	**/
	public String getTboiBuyer$(){
		String strValue="";
	
	
		 
		if(this.getTboiBuyer()!=null){
			
				strValue+=Utils.string(Member.getKeyValue(this.getTboiBuyer()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据购买人反格式化
	**/
	public void setTboiBuyer$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiBuyer=null;
			return;
		}
	
	
		 
		Member item = Member.find(strValue);
		if(item!=null){
			
			this.tboiBuyer = Utils.parseLong(item.getUid());
			
		}
		 
	 
	}
	
	/**
	* 购买人  [Member]     
	**/
	public void setTboiBuyer(Long tboiBuyer){
		this.tboiBuyer = tboiBuyer;
		
		this.setSeted(F.tboiBuyer);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[会员信息]
	**/	 			
 	public Member get$tboiBuyer(){
 		if(this.$tboiBuyer!=null)
 			return this.$tboiBuyer;
 		com.distribute.framework.model.Member member = null;
		if(this.getTboiBuyer()!=null){
		
 			member = Member.get(this.getTboiBuyer());
 		
 		}
 		return member;
	}
	
 	
	
	
	/*******************************订单总金额**********************************/	
	/**
	* 订单总金额       
	**/
	public Double getTboiTotal(){
		
		if(this.tboiTotal!=null){
			return this.tboiTotal;
		}
		
		return this.tboiTotal;
	}
	/**
	* 获取订单总金额格式化(toString)
	**/
	public String getTboiTotal$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiTotal());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据订单总金额反格式化
	**/
	public void setTboiTotal$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiTotal=null;
			return;
		}
	
	
	 	this.tboiTotal=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 订单总金额       
	**/
	public void setTboiTotal(Double tboiTotal){
		this.tboiTotal = tboiTotal;
		
		this.setSeted(F.tboiTotal);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************实际支付金额**********************************/	
	/**
	* 实际支付金额       
	**/
	public Double getTboiMoney(){
		
		if(this.tboiMoney!=null){
			return this.tboiMoney;
		}
		
		return this.tboiMoney;
	}
	/**
	* 获取实际支付金额格式化(toString)
	**/
	public String getTboiMoney$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiMoney());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据实际支付金额反格式化
	**/
	public void setTboiMoney$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiMoney=null;
			return;
		}
	
	
	 	this.tboiMoney=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 实际支付金额       
	**/
	public void setTboiMoney(Double tboiMoney){
		this.tboiMoney = tboiMoney;
		
		this.setSeted(F.tboiMoney);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************余额抵扣金额**********************************/	
	/**
	* 余额抵扣金额       
	**/
	public Double getTboiProduct(){
		
		if(this.tboiProduct!=null){
			return this.tboiProduct;
		}
		
		return this.tboiProduct;
	}
	/**
	* 获取余额抵扣金额格式化(toString)
	**/
	public String getTboiProduct$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiProduct());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据余额抵扣金额反格式化
	**/
	public void setTboiProduct$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiProduct=null;
			return;
		}
	
	
	 	this.tboiProduct=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 余额抵扣金额       
	**/
	public void setTboiProduct(Double tboiProduct){
		this.tboiProduct = tboiProduct;
		
		this.setSeted(F.tboiProduct);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************优惠卷抵扣金额**********************************/	
	/**
	* 优惠卷抵扣金额       
	**/
	public Double getTboiCoupon(){
		
		if(this.tboiCoupon!=null){
			return this.tboiCoupon;
		}
		
		return this.tboiCoupon;
	}
	/**
	* 获取优惠卷抵扣金额格式化(toString)
	**/
	public String getTboiCoupon$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiCoupon());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据优惠卷抵扣金额反格式化
	**/
	public void setTboiCoupon$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiCoupon=null;
			return;
		}
	
	
	 	this.tboiCoupon=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 优惠卷抵扣金额       
	**/
	public void setTboiCoupon(Double tboiCoupon){
		this.tboiCoupon = tboiCoupon;
		
		this.setSeted(F.tboiCoupon);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************平台收益**********************************/	
	/**
	* 平台收益       
	**/
	public Double getTboiPtSy(){
		
		if(this.tboiPtSy!=null){
			return this.tboiPtSy;
		}
		
		return this.tboiPtSy;
	}
	/**
	* 获取平台收益格式化(toString)
	**/
	public String getTboiPtSy$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiPtSy());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据平台收益反格式化
	**/
	public void setTboiPtSy$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiPtSy=null;
			return;
		}
	
	
	 	this.tboiPtSy=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 平台收益       
	**/
	public void setTboiPtSy(Double tboiPtSy){
		this.tboiPtSy = tboiPtSy;
		
		this.setSeted(F.tboiPtSy);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************普通间接收益**********************************/	
	/**
	* 普通间接收益       
	**/
	public Double getTboiPtJj(){
		
		if(this.tboiPtJj!=null){
			return this.tboiPtJj;
		}
		
		return this.tboiPtJj;
	}
	/**
	* 获取普通间接收益格式化(toString)
	**/
	public String getTboiPtJj$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiPtJj());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据普通间接收益反格式化
	**/
	public void setTboiPtJj$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiPtJj=null;
			return;
		}
	
	
	 	this.tboiPtJj=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 普通间接收益       
	**/
	public void setTboiPtJj(Double tboiPtJj){
		this.tboiPtJj = tboiPtJj;
		
		this.setSeted(F.tboiPtJj);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************普通直接收益**********************************/	
	/**
	* 普通直接收益       
	**/
	public Double getTboiPtZj(){
		
		if(this.tboiPtZj!=null){
			return this.tboiPtZj;
		}
		
		return this.tboiPtZj;
	}
	/**
	* 获取普通直接收益格式化(toString)
	**/
	public String getTboiPtZj$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiPtZj());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据普通直接收益反格式化
	**/
	public void setTboiPtZj$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiPtZj=null;
			return;
		}
	
	
	 	this.tboiPtZj=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 普通直接收益       
	**/
	public void setTboiPtZj(Double tboiPtZj){
		this.tboiPtZj = tboiPtZj;
		
		this.setSeted(F.tboiPtZj);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************代理间接收益**********************************/	
	/**
	* 代理间接收益       
	**/
	public Double getTboiDlJj(){
		
		if(this.tboiDlJj!=null){
			return this.tboiDlJj;
		}
		
		return this.tboiDlJj;
	}
	/**
	* 获取代理间接收益格式化(toString)
	**/
	public String getTboiDlJj$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiDlJj());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据代理间接收益反格式化
	**/
	public void setTboiDlJj$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiDlJj=null;
			return;
		}
	
	
	 	this.tboiDlJj=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 代理间接收益       
	**/
	public void setTboiDlJj(Double tboiDlJj){
		this.tboiDlJj = tboiDlJj;
		
		this.setSeted(F.tboiDlJj);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************代理直接收益**********************************/	
	/**
	* 代理直接收益       
	**/
	public Double getTboiDlZj(){
		
		if(this.tboiDlZj!=null){
			return this.tboiDlZj;
		}
		
		return this.tboiDlZj;
	}
	/**
	* 获取代理直接收益格式化(toString)
	**/
	public String getTboiDlZj$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiDlZj());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据代理直接收益反格式化
	**/
	public void setTboiDlZj$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiDlZj=null;
			return;
		}
	
	
	 	this.tboiDlZj=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 代理直接收益       
	**/
	public void setTboiDlZj(Double tboiDlZj){
		this.tboiDlZj = tboiDlZj;
		
		this.setSeted(F.tboiDlZj);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************合伙人收益**********************************/	
	/**
	* 合伙人收益       
	**/
	public Double getTboiHhrSy(){
		
		if(this.tboiHhrSy!=null){
			return this.tboiHhrSy;
		}
		
		return this.tboiHhrSy;
	}
	/**
	* 获取合伙人收益格式化(toString)
	**/
	public String getTboiHhrSy$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiHhrSy());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据合伙人收益反格式化
	**/
	public void setTboiHhrSy$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiHhrSy=null;
			return;
		}
	
	
	 	this.tboiHhrSy=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 合伙人收益       
	**/
	public void setTboiHhrSy(Double tboiHhrSy){
		this.tboiHhrSy = tboiHhrSy;
		
		this.setSeted(F.tboiHhrSy);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************配送商收益**********************************/	
	/**
	* 配送商收益       
	**/
	public Double getTboiPsSy(){
		
		if(this.tboiPsSy!=null){
			return this.tboiPsSy;
		}
		
		return this.tboiPsSy;
	}
	/**
	* 获取配送商收益格式化(toString)
	**/
	public String getTboiPsSy$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiPsSy());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据配送商收益反格式化
	**/
	public void setTboiPsSy$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiPsSy=null;
			return;
		}
	
	
	 	this.tboiPsSy=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 配送商收益       
	**/
	public void setTboiPsSy(Double tboiPsSy){
		this.tboiPsSy = tboiPsSy;
		
		this.setSeted(F.tboiPsSy);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************经销商收益**********************************/	
	/**
	* 经销商收益       
	**/
	public Double getTboiJxsSy(){
		
		if(this.tboiJxsSy!=null){
			return this.tboiJxsSy;
		}
		
		return this.tboiJxsSy;
	}
	/**
	* 获取经销商收益格式化(toString)
	**/
	public String getTboiJxsSy$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiJxsSy());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据经销商收益反格式化
	**/
	public void setTboiJxsSy$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiJxsSy=null;
			return;
		}
	
	
	 	this.tboiJxsSy=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 经销商收益       
	**/
	public void setTboiJxsSy(Double tboiJxsSy){
		this.tboiJxsSy = tboiJxsSy;
		
		this.setSeted(F.tboiJxsSy);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************剩余收益**********************************/	
	/**
	* 剩余收益       
	**/
	public Double getTboiSySy(){
		
		if(this.tboiSySy!=null){
			return this.tboiSySy;
		}
		
		return this.tboiSySy;
	}
	/**
	* 获取剩余收益格式化(toString)
	**/
	public String getTboiSySy$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTboiSySy());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据剩余收益反格式化
	**/
	public void setTboiSySy$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiSySy=null;
			return;
		}
	
	
	 	this.tboiSySy=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 剩余收益       
	**/
	public void setTboiSySy(Double tboiSySy){
		this.tboiSySy = tboiSySy;
		
		this.setSeted(F.tboiSySy);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************添加时间**********************************/	
	/**
	* 添加时间       
	**/
	public Date getTboiAddTime(){
		
		if(this.tboiAddTime!=null){
			return this.tboiAddTime;
		}
		
		return this.tboiAddTime;
	}
	/**
	* 获取添加时间格式化(toString)
	**/
	public String getTboiAddTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getTboiAddTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据添加时间反格式化
	**/
	public void setTboiAddTime$(String strValue){
		if(Utils.empty(strValue)){
			this.tboiAddTime=null;
			return;
		}
	
	
	 	this.tboiAddTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 添加时间       
	**/
	public void setTboiAddTime(Date tboiAddTime){
		this.tboiAddTime = tboiAddTime;
		
		this.setSeted(F.tboiAddTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	
	/************LAZY3Q_DEFINE_CODE************/
	/************LAZY3Q_DEFINE_CODE************/	
	
	
	/**
	 * 触发器
	 */
	public static void on(Trigger.Index index,final Notify.Listener listener,Trigger.Type... types){
		Notify.on(TbOrderInvoies.class, index, listener, types);
	}
	public static void on(final Notify.Listener listener,String type){
		Notify.on(TbOrderInvoies.class, listener, type);
	}
	/**
	 * 当修改字段时
	 * @param filedName
	 * @param listener
	 */
	public static void on(String filedName,final Notify.Listener listener){
		Notify.on(TbOrderInvoies.class, listener, filedName);
	}
	/**
	 * 当修改字段为某值时
	 * @param filedName
	 * @param value
	 * @param listener
	 */
	public static void on(String filedName,Object value,final Notify.Listener listener){
		if(value==null)return;
		Notify.on(TbOrderInvoies.class, listener, filedName+"."+Utils.md5(""+value));
	}
	public void notify(String type){
		Trigger.on(TbOrderInvoies.class,type, this);
	}
	
	
	/**
	 * 用来获取当有字段关联对象时的获取方式,调用如${TbOrderInvoies.obj.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${TbOrderInvoies.$filedName}获取关联对象
	 */
	public Map getObj(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return TbOrderInvoies.class.getMethod("get$"+Utils.forMat(key.toString())).invoke(TbOrderInvoies.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 用来获取某字段格式化的获取方式,调用如${TbOrderInvoies.fmt.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${TbOrderInvoies.filedName$}获取某字段格式化
	 */
	public Map getFmt(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return TbOrderInvoies.class.getMethod("get"+Utils.ForMat(key.toString()+"$")).invoke(TbOrderInvoies.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 获取查询参数链式串
	 * @return
	 */
	public static @Deprecated M where(){ return new M(0); }
	public static @Deprecated M m(){ return new M(0); }
	public static M where = new M(0,true);
	public static @database(DatabaseNames.distribute_sys) class M extends IbatisMap{
		int type = 0; 
		M linked = null;
		Boolean proxy = false;
		public M set = null;
		public M(int type){
			this.type = type;
			if(this.type==0){
				set = new M(1,true);
				set.linked = this;
			}
		};
		public M(int type,Boolean proxy){
			this.type = type;
			this.proxy=proxy;
		};
		public M proxy(){
			M m = new M(this.type);//当前的对像
			if(this.type==0){
				m.set = new M(1,true);//set对象
				m.set.linked = m;
			}else{
				m.linked=this.linked;
				this.linked.linked=m;
			}
			return m;
		}
		public @Deprecated M set(){			
			M m = this;
			m.linked=new M(1);
			m.linked.linked=m;
			return m.linked;
		};
		
		public M on(IbatisMap value,C column,String joinColumn){if(proxy)return proxy().on(value,column,joinColumn);this.put(value.getClass().getDeclaringClass().getSimpleName(), value);value.put("on", column.toString());value.put("to", joinColumn);return this;};
		
		
			
		
		/** 编号 [非空]       **/
		public M tboiId(Object tboiId){if(proxy)return proxy().tboiId(tboiId);  this.put("tboiId", tboiId);return this;};
	 	/** and tboi_id is null */
 		public M tboiIdNull(){if(proxy)return proxy().tboiIdNull();if(this.get("tboiIdNot")==null)this.put("tboiIdNot", "");this.put("tboiId", null);return this;};
 		/** not .... */
 		public M tboiIdNot(){if(proxy)return proxy().tboiIdNot();this.put("tboiIdNot", "not");return this;};
 		public M tboiIdNotNull(){if(proxy)return proxy().tboiIdNotNull();this.put("tboiIdNot", "not");this.put("tboiId", null);return this;};
 		public M tboiIdNot(Object tboiId){if(proxy)return proxy().tboiIdNot(tboiId);this.put("tboiIdNot", "not");this.put("tboiId", tboiId);return this;};
	 		
		/** and tboi_id <= ? */
		public M tboiIdMin(Object min){if(proxy)return proxy().tboiIdMin(min);this.put("tboiIdMin", min);return this;};
		/** and tboi_id >= ? */
		public M tboiIdMax(Object max){if(proxy)return proxy().tboiIdMax(max);this.put("tboiIdMax", max);return this;};
			
			
		public M tboiIdIn(String ids){
			if(proxy)return proxy().tboiIdIn(ids);  this.put("tboiIdIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 订单编号        **/
		public M tboiOrderNumber(Object tboiOrderNumber){if(proxy)return proxy().tboiOrderNumber(tboiOrderNumber);  this.put("tboiOrderNumber", tboiOrderNumber);return this;};
	 	/** and tboi_order_number is null */
 		public M tboiOrderNumberNull(){if(proxy)return proxy().tboiOrderNumberNull();if(this.get("tboiOrderNumberNot")==null)this.put("tboiOrderNumberNot", "");this.put("tboiOrderNumber", null);return this;};
 		/** not .... */
 		public M tboiOrderNumberNot(){if(proxy)return proxy().tboiOrderNumberNot();this.put("tboiOrderNumberNot", "not");return this;};
 		public M tboiOrderNumberNotNull(){if(proxy)return proxy().tboiOrderNumberNotNull();this.put("tboiOrderNumberNot", "not");this.put("tboiOrderNumber", null);return this;};
 		public M tboiOrderNumberNot(Object tboiOrderNumber){if(proxy)return proxy().tboiOrderNumberNot(tboiOrderNumber);this.put("tboiOrderNumberNot", "not");this.put("tboiOrderNumber", tboiOrderNumber);return this;};
	 		
			
		
			
	 	
			
		
		/** 来源    1:直接购买 2:余额充值 3:代理购买 4:合伙人购买     **/
		public M tboiSource(Object tboiSource){if(proxy)return proxy().tboiSource(tboiSource);  this.put("tboiSource", tboiSource);return this;};
	 	/** and tboi_source is null */
 		public M tboiSourceNull(){if(proxy)return proxy().tboiSourceNull();if(this.get("tboiSourceNot")==null)this.put("tboiSourceNot", "");this.put("tboiSource", null);return this;};
 		/** not .... */
 		public M tboiSourceNot(){if(proxy)return proxy().tboiSourceNot();this.put("tboiSourceNot", "not");return this;};
 		public M tboiSourceNotNull(){if(proxy)return proxy().tboiSourceNotNull();this.put("tboiSourceNot", "not");this.put("tboiSource", null);return this;};
 		public M tboiSourceNot(Object tboiSource){if(proxy)return proxy().tboiSourceNot(tboiSource);this.put("tboiSourceNot", "not");this.put("tboiSource", tboiSource);return this;};
	 		
			
		public M tboiSourceIn(String ids){
			if(proxy)return proxy().tboiSourceIn(ids);  this.put("tboiSourceIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M tboiBrand$on(Merchant.M value){if(proxy)return proxy().tboiBrand$on(value);this.put("TboiBrand", value);value.put("on", "tboi_brand");return this;};
 				
 			
		
		/** 所属品牌  [Merchant]      **/
		public M tboiBrand(Object tboiBrand){if(proxy)return proxy().tboiBrand(tboiBrand);  this.put("tboiBrand", tboiBrand);return this;};
	 	/** and tboi_brand is null */
 		public M tboiBrandNull(){if(proxy)return proxy().tboiBrandNull();if(this.get("tboiBrandNot")==null)this.put("tboiBrandNot", "");this.put("tboiBrand", null);return this;};
 		/** not .... */
 		public M tboiBrandNot(){if(proxy)return proxy().tboiBrandNot();this.put("tboiBrandNot", "not");return this;};
 		public M tboiBrandNotNull(){if(proxy)return proxy().tboiBrandNotNull();this.put("tboiBrandNot", "not");this.put("tboiBrand", null);return this;};
 		public M tboiBrandNot(Object tboiBrand){if(proxy)return proxy().tboiBrandNot(tboiBrand);this.put("tboiBrandNot", "not");this.put("tboiBrand", tboiBrand);return this;};
	 		
		/** and tboi_brand <= ? */
		public M tboiBrandMin(Object min){if(proxy)return proxy().tboiBrandMin(min);this.put("tboiBrandMin", min);return this;};
		/** and tboi_brand >= ? */
		public M tboiBrandMax(Object max){if(proxy)return proxy().tboiBrandMax(max);this.put("tboiBrandMax", max);return this;};
			
			
		public M tboiBrandIn(String ids){
			if(proxy)return proxy().tboiBrandIn(ids);  this.put("tboiBrandIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M tboiBuyer$on(Member.M value){if(proxy)return proxy().tboiBuyer$on(value);this.put("TboiBuyer", value);value.put("on", "tboi_buyer");return this;};
 				
 			
		
		/** 购买人  [Member]      **/
		public M tboiBuyer(Object tboiBuyer){if(proxy)return proxy().tboiBuyer(tboiBuyer);  this.put("tboiBuyer", tboiBuyer);return this;};
	 	/** and tboi_buyer is null */
 		public M tboiBuyerNull(){if(proxy)return proxy().tboiBuyerNull();if(this.get("tboiBuyerNot")==null)this.put("tboiBuyerNot", "");this.put("tboiBuyer", null);return this;};
 		/** not .... */
 		public M tboiBuyerNot(){if(proxy)return proxy().tboiBuyerNot();this.put("tboiBuyerNot", "not");return this;};
 		public M tboiBuyerNotNull(){if(proxy)return proxy().tboiBuyerNotNull();this.put("tboiBuyerNot", "not");this.put("tboiBuyer", null);return this;};
 		public M tboiBuyerNot(Object tboiBuyer){if(proxy)return proxy().tboiBuyerNot(tboiBuyer);this.put("tboiBuyerNot", "not");this.put("tboiBuyer", tboiBuyer);return this;};
	 		
			
		public M tboiBuyerIn(String ids){
			if(proxy)return proxy().tboiBuyerIn(ids);  this.put("tboiBuyerIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 订单总金额        **/
		public M tboiTotal(Object tboiTotal){if(proxy)return proxy().tboiTotal(tboiTotal);  this.put("tboiTotal", tboiTotal);return this;};
	 	/** and tboi_total is null */
 		public M tboiTotalNull(){if(proxy)return proxy().tboiTotalNull();if(this.get("tboiTotalNot")==null)this.put("tboiTotalNot", "");this.put("tboiTotal", null);return this;};
 		/** not .... */
 		public M tboiTotalNot(){if(proxy)return proxy().tboiTotalNot();this.put("tboiTotalNot", "not");return this;};
 		public M tboiTotalNotNull(){if(proxy)return proxy().tboiTotalNotNull();this.put("tboiTotalNot", "not");this.put("tboiTotal", null);return this;};
 		public M tboiTotalNot(Object tboiTotal){if(proxy)return proxy().tboiTotalNot(tboiTotal);this.put("tboiTotalNot", "not");this.put("tboiTotal", tboiTotal);return this;};
	 		
		/** and tboi_total <= ? */
		public M tboiTotalMin(Object min){if(proxy)return proxy().tboiTotalMin(min);this.put("tboiTotalMin", min);return this;};
		/** and tboi_total >= ? */
		public M tboiTotalMax(Object max){if(proxy)return proxy().tboiTotalMax(max);this.put("tboiTotalMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 实际支付金额        **/
		public M tboiMoney(Object tboiMoney){if(proxy)return proxy().tboiMoney(tboiMoney);  this.put("tboiMoney", tboiMoney);return this;};
	 	/** and tboi_money is null */
 		public M tboiMoneyNull(){if(proxy)return proxy().tboiMoneyNull();if(this.get("tboiMoneyNot")==null)this.put("tboiMoneyNot", "");this.put("tboiMoney", null);return this;};
 		/** not .... */
 		public M tboiMoneyNot(){if(proxy)return proxy().tboiMoneyNot();this.put("tboiMoneyNot", "not");return this;};
 		public M tboiMoneyNotNull(){if(proxy)return proxy().tboiMoneyNotNull();this.put("tboiMoneyNot", "not");this.put("tboiMoney", null);return this;};
 		public M tboiMoneyNot(Object tboiMoney){if(proxy)return proxy().tboiMoneyNot(tboiMoney);this.put("tboiMoneyNot", "not");this.put("tboiMoney", tboiMoney);return this;};
	 		
		/** and tboi_money <= ? */
		public M tboiMoneyMin(Object min){if(proxy)return proxy().tboiMoneyMin(min);this.put("tboiMoneyMin", min);return this;};
		/** and tboi_money >= ? */
		public M tboiMoneyMax(Object max){if(proxy)return proxy().tboiMoneyMax(max);this.put("tboiMoneyMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 余额抵扣金额        **/
		public M tboiProduct(Object tboiProduct){if(proxy)return proxy().tboiProduct(tboiProduct);  this.put("tboiProduct", tboiProduct);return this;};
	 	/** and tboi_product is null */
 		public M tboiProductNull(){if(proxy)return proxy().tboiProductNull();if(this.get("tboiProductNot")==null)this.put("tboiProductNot", "");this.put("tboiProduct", null);return this;};
 		/** not .... */
 		public M tboiProductNot(){if(proxy)return proxy().tboiProductNot();this.put("tboiProductNot", "not");return this;};
 		public M tboiProductNotNull(){if(proxy)return proxy().tboiProductNotNull();this.put("tboiProductNot", "not");this.put("tboiProduct", null);return this;};
 		public M tboiProductNot(Object tboiProduct){if(proxy)return proxy().tboiProductNot(tboiProduct);this.put("tboiProductNot", "not");this.put("tboiProduct", tboiProduct);return this;};
	 		
		/** and tboi_product <= ? */
		public M tboiProductMin(Object min){if(proxy)return proxy().tboiProductMin(min);this.put("tboiProductMin", min);return this;};
		/** and tboi_product >= ? */
		public M tboiProductMax(Object max){if(proxy)return proxy().tboiProductMax(max);this.put("tboiProductMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 优惠卷抵扣金额        **/
		public M tboiCoupon(Object tboiCoupon){if(proxy)return proxy().tboiCoupon(tboiCoupon);  this.put("tboiCoupon", tboiCoupon);return this;};
	 	/** and tboi_coupon is null */
 		public M tboiCouponNull(){if(proxy)return proxy().tboiCouponNull();if(this.get("tboiCouponNot")==null)this.put("tboiCouponNot", "");this.put("tboiCoupon", null);return this;};
 		/** not .... */
 		public M tboiCouponNot(){if(proxy)return proxy().tboiCouponNot();this.put("tboiCouponNot", "not");return this;};
 		public M tboiCouponNotNull(){if(proxy)return proxy().tboiCouponNotNull();this.put("tboiCouponNot", "not");this.put("tboiCoupon", null);return this;};
 		public M tboiCouponNot(Object tboiCoupon){if(proxy)return proxy().tboiCouponNot(tboiCoupon);this.put("tboiCouponNot", "not");this.put("tboiCoupon", tboiCoupon);return this;};
	 		
		/** and tboi_coupon <= ? */
		public M tboiCouponMin(Object min){if(proxy)return proxy().tboiCouponMin(min);this.put("tboiCouponMin", min);return this;};
		/** and tboi_coupon >= ? */
		public M tboiCouponMax(Object max){if(proxy)return proxy().tboiCouponMax(max);this.put("tboiCouponMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 平台收益        **/
		public M tboiPtSy(Object tboiPtSy){if(proxy)return proxy().tboiPtSy(tboiPtSy);  this.put("tboiPtSy", tboiPtSy);return this;};
	 	/** and tboi_pt_sy is null */
 		public M tboiPtSyNull(){if(proxy)return proxy().tboiPtSyNull();if(this.get("tboiPtSyNot")==null)this.put("tboiPtSyNot", "");this.put("tboiPtSy", null);return this;};
 		/** not .... */
 		public M tboiPtSyNot(){if(proxy)return proxy().tboiPtSyNot();this.put("tboiPtSyNot", "not");return this;};
 		public M tboiPtSyNotNull(){if(proxy)return proxy().tboiPtSyNotNull();this.put("tboiPtSyNot", "not");this.put("tboiPtSy", null);return this;};
 		public M tboiPtSyNot(Object tboiPtSy){if(proxy)return proxy().tboiPtSyNot(tboiPtSy);this.put("tboiPtSyNot", "not");this.put("tboiPtSy", tboiPtSy);return this;};
	 		
		/** and tboi_pt_sy <= ? */
		public M tboiPtSyMin(Object min){if(proxy)return proxy().tboiPtSyMin(min);this.put("tboiPtSyMin", min);return this;};
		/** and tboi_pt_sy >= ? */
		public M tboiPtSyMax(Object max){if(proxy)return proxy().tboiPtSyMax(max);this.put("tboiPtSyMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 普通间接收益        **/
		public M tboiPtJj(Object tboiPtJj){if(proxy)return proxy().tboiPtJj(tboiPtJj);  this.put("tboiPtJj", tboiPtJj);return this;};
	 	/** and tboi_pt_jj is null */
 		public M tboiPtJjNull(){if(proxy)return proxy().tboiPtJjNull();if(this.get("tboiPtJjNot")==null)this.put("tboiPtJjNot", "");this.put("tboiPtJj", null);return this;};
 		/** not .... */
 		public M tboiPtJjNot(){if(proxy)return proxy().tboiPtJjNot();this.put("tboiPtJjNot", "not");return this;};
 		public M tboiPtJjNotNull(){if(proxy)return proxy().tboiPtJjNotNull();this.put("tboiPtJjNot", "not");this.put("tboiPtJj", null);return this;};
 		public M tboiPtJjNot(Object tboiPtJj){if(proxy)return proxy().tboiPtJjNot(tboiPtJj);this.put("tboiPtJjNot", "not");this.put("tboiPtJj", tboiPtJj);return this;};
	 		
		/** and tboi_pt_jj <= ? */
		public M tboiPtJjMin(Object min){if(proxy)return proxy().tboiPtJjMin(min);this.put("tboiPtJjMin", min);return this;};
		/** and tboi_pt_jj >= ? */
		public M tboiPtJjMax(Object max){if(proxy)return proxy().tboiPtJjMax(max);this.put("tboiPtJjMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 普通直接收益        **/
		public M tboiPtZj(Object tboiPtZj){if(proxy)return proxy().tboiPtZj(tboiPtZj);  this.put("tboiPtZj", tboiPtZj);return this;};
	 	/** and tboi_pt_zj is null */
 		public M tboiPtZjNull(){if(proxy)return proxy().tboiPtZjNull();if(this.get("tboiPtZjNot")==null)this.put("tboiPtZjNot", "");this.put("tboiPtZj", null);return this;};
 		/** not .... */
 		public M tboiPtZjNot(){if(proxy)return proxy().tboiPtZjNot();this.put("tboiPtZjNot", "not");return this;};
 		public M tboiPtZjNotNull(){if(proxy)return proxy().tboiPtZjNotNull();this.put("tboiPtZjNot", "not");this.put("tboiPtZj", null);return this;};
 		public M tboiPtZjNot(Object tboiPtZj){if(proxy)return proxy().tboiPtZjNot(tboiPtZj);this.put("tboiPtZjNot", "not");this.put("tboiPtZj", tboiPtZj);return this;};
	 		
		/** and tboi_pt_zj <= ? */
		public M tboiPtZjMin(Object min){if(proxy)return proxy().tboiPtZjMin(min);this.put("tboiPtZjMin", min);return this;};
		/** and tboi_pt_zj >= ? */
		public M tboiPtZjMax(Object max){if(proxy)return proxy().tboiPtZjMax(max);this.put("tboiPtZjMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 代理间接收益        **/
		public M tboiDlJj(Object tboiDlJj){if(proxy)return proxy().tboiDlJj(tboiDlJj);  this.put("tboiDlJj", tboiDlJj);return this;};
	 	/** and tboi_dl_jj is null */
 		public M tboiDlJjNull(){if(proxy)return proxy().tboiDlJjNull();if(this.get("tboiDlJjNot")==null)this.put("tboiDlJjNot", "");this.put("tboiDlJj", null);return this;};
 		/** not .... */
 		public M tboiDlJjNot(){if(proxy)return proxy().tboiDlJjNot();this.put("tboiDlJjNot", "not");return this;};
 		public M tboiDlJjNotNull(){if(proxy)return proxy().tboiDlJjNotNull();this.put("tboiDlJjNot", "not");this.put("tboiDlJj", null);return this;};
 		public M tboiDlJjNot(Object tboiDlJj){if(proxy)return proxy().tboiDlJjNot(tboiDlJj);this.put("tboiDlJjNot", "not");this.put("tboiDlJj", tboiDlJj);return this;};
	 		
		/** and tboi_dl_jj <= ? */
		public M tboiDlJjMin(Object min){if(proxy)return proxy().tboiDlJjMin(min);this.put("tboiDlJjMin", min);return this;};
		/** and tboi_dl_jj >= ? */
		public M tboiDlJjMax(Object max){if(proxy)return proxy().tboiDlJjMax(max);this.put("tboiDlJjMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 代理直接收益        **/
		public M tboiDlZj(Object tboiDlZj){if(proxy)return proxy().tboiDlZj(tboiDlZj);  this.put("tboiDlZj", tboiDlZj);return this;};
	 	/** and tboi_dl_zj is null */
 		public M tboiDlZjNull(){if(proxy)return proxy().tboiDlZjNull();if(this.get("tboiDlZjNot")==null)this.put("tboiDlZjNot", "");this.put("tboiDlZj", null);return this;};
 		/** not .... */
 		public M tboiDlZjNot(){if(proxy)return proxy().tboiDlZjNot();this.put("tboiDlZjNot", "not");return this;};
 		public M tboiDlZjNotNull(){if(proxy)return proxy().tboiDlZjNotNull();this.put("tboiDlZjNot", "not");this.put("tboiDlZj", null);return this;};
 		public M tboiDlZjNot(Object tboiDlZj){if(proxy)return proxy().tboiDlZjNot(tboiDlZj);this.put("tboiDlZjNot", "not");this.put("tboiDlZj", tboiDlZj);return this;};
	 		
		/** and tboi_dl_zj <= ? */
		public M tboiDlZjMin(Object min){if(proxy)return proxy().tboiDlZjMin(min);this.put("tboiDlZjMin", min);return this;};
		/** and tboi_dl_zj >= ? */
		public M tboiDlZjMax(Object max){if(proxy)return proxy().tboiDlZjMax(max);this.put("tboiDlZjMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 合伙人收益        **/
		public M tboiHhrSy(Object tboiHhrSy){if(proxy)return proxy().tboiHhrSy(tboiHhrSy);  this.put("tboiHhrSy", tboiHhrSy);return this;};
	 	/** and tboi_hhr_sy is null */
 		public M tboiHhrSyNull(){if(proxy)return proxy().tboiHhrSyNull();if(this.get("tboiHhrSyNot")==null)this.put("tboiHhrSyNot", "");this.put("tboiHhrSy", null);return this;};
 		/** not .... */
 		public M tboiHhrSyNot(){if(proxy)return proxy().tboiHhrSyNot();this.put("tboiHhrSyNot", "not");return this;};
 		public M tboiHhrSyNotNull(){if(proxy)return proxy().tboiHhrSyNotNull();this.put("tboiHhrSyNot", "not");this.put("tboiHhrSy", null);return this;};
 		public M tboiHhrSyNot(Object tboiHhrSy){if(proxy)return proxy().tboiHhrSyNot(tboiHhrSy);this.put("tboiHhrSyNot", "not");this.put("tboiHhrSy", tboiHhrSy);return this;};
	 		
		/** and tboi_hhr_sy <= ? */
		public M tboiHhrSyMin(Object min){if(proxy)return proxy().tboiHhrSyMin(min);this.put("tboiHhrSyMin", min);return this;};
		/** and tboi_hhr_sy >= ? */
		public M tboiHhrSyMax(Object max){if(proxy)return proxy().tboiHhrSyMax(max);this.put("tboiHhrSyMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 配送商收益        **/
		public M tboiPsSy(Object tboiPsSy){if(proxy)return proxy().tboiPsSy(tboiPsSy);  this.put("tboiPsSy", tboiPsSy);return this;};
	 	/** and tboi_ps_sy is null */
 		public M tboiPsSyNull(){if(proxy)return proxy().tboiPsSyNull();if(this.get("tboiPsSyNot")==null)this.put("tboiPsSyNot", "");this.put("tboiPsSy", null);return this;};
 		/** not .... */
 		public M tboiPsSyNot(){if(proxy)return proxy().tboiPsSyNot();this.put("tboiPsSyNot", "not");return this;};
 		public M tboiPsSyNotNull(){if(proxy)return proxy().tboiPsSyNotNull();this.put("tboiPsSyNot", "not");this.put("tboiPsSy", null);return this;};
 		public M tboiPsSyNot(Object tboiPsSy){if(proxy)return proxy().tboiPsSyNot(tboiPsSy);this.put("tboiPsSyNot", "not");this.put("tboiPsSy", tboiPsSy);return this;};
	 		
		/** and tboi_ps_sy <= ? */
		public M tboiPsSyMin(Object min){if(proxy)return proxy().tboiPsSyMin(min);this.put("tboiPsSyMin", min);return this;};
		/** and tboi_ps_sy >= ? */
		public M tboiPsSyMax(Object max){if(proxy)return proxy().tboiPsSyMax(max);this.put("tboiPsSyMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 经销商收益        **/
		public M tboiJxsSy(Object tboiJxsSy){if(proxy)return proxy().tboiJxsSy(tboiJxsSy);  this.put("tboiJxsSy", tboiJxsSy);return this;};
	 	/** and tboi_jxs_sy is null */
 		public M tboiJxsSyNull(){if(proxy)return proxy().tboiJxsSyNull();if(this.get("tboiJxsSyNot")==null)this.put("tboiJxsSyNot", "");this.put("tboiJxsSy", null);return this;};
 		/** not .... */
 		public M tboiJxsSyNot(){if(proxy)return proxy().tboiJxsSyNot();this.put("tboiJxsSyNot", "not");return this;};
 		public M tboiJxsSyNotNull(){if(proxy)return proxy().tboiJxsSyNotNull();this.put("tboiJxsSyNot", "not");this.put("tboiJxsSy", null);return this;};
 		public M tboiJxsSyNot(Object tboiJxsSy){if(proxy)return proxy().tboiJxsSyNot(tboiJxsSy);this.put("tboiJxsSyNot", "not");this.put("tboiJxsSy", tboiJxsSy);return this;};
	 		
		/** and tboi_jxs_sy <= ? */
		public M tboiJxsSyMin(Object min){if(proxy)return proxy().tboiJxsSyMin(min);this.put("tboiJxsSyMin", min);return this;};
		/** and tboi_jxs_sy >= ? */
		public M tboiJxsSyMax(Object max){if(proxy)return proxy().tboiJxsSyMax(max);this.put("tboiJxsSyMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 剩余收益        **/
		public M tboiSySy(Object tboiSySy){if(proxy)return proxy().tboiSySy(tboiSySy);  this.put("tboiSySy", tboiSySy);return this;};
	 	/** and tboi_sy_sy is null */
 		public M tboiSySyNull(){if(proxy)return proxy().tboiSySyNull();if(this.get("tboiSySyNot")==null)this.put("tboiSySyNot", "");this.put("tboiSySy", null);return this;};
 		/** not .... */
 		public M tboiSySyNot(){if(proxy)return proxy().tboiSySyNot();this.put("tboiSySyNot", "not");return this;};
 		public M tboiSySyNotNull(){if(proxy)return proxy().tboiSySyNotNull();this.put("tboiSySyNot", "not");this.put("tboiSySy", null);return this;};
 		public M tboiSySyNot(Object tboiSySy){if(proxy)return proxy().tboiSySyNot(tboiSySy);this.put("tboiSySyNot", "not");this.put("tboiSySy", tboiSySy);return this;};
	 		
		/** and tboi_sy_sy <= ? */
		public M tboiSySyMin(Object min){if(proxy)return proxy().tboiSySyMin(min);this.put("tboiSySyMin", min);return this;};
		/** and tboi_sy_sy >= ? */
		public M tboiSySyMax(Object max){if(proxy)return proxy().tboiSySyMax(max);this.put("tboiSySyMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 添加时间        **/
		public M tboiAddTime(Object tboiAddTime){if(proxy)return proxy().tboiAddTime(tboiAddTime);  this.put("tboiAddTime", tboiAddTime);return this;};
	 	/** and tboi_add_time is null */
 		public M tboiAddTimeNull(){if(proxy)return proxy().tboiAddTimeNull();if(this.get("tboiAddTimeNot")==null)this.put("tboiAddTimeNot", "");this.put("tboiAddTime", null);return this;};
 		/** not .... */
 		public M tboiAddTimeNot(){if(proxy)return proxy().tboiAddTimeNot();this.put("tboiAddTimeNot", "not");return this;};
 		public M tboiAddTimeNotNull(){if(proxy)return proxy().tboiAddTimeNotNull();this.put("tboiAddTimeNot", "not");this.put("tboiAddTime", null);return this;};
 		public M tboiAddTimeNot(Object tboiAddTime){if(proxy)return proxy().tboiAddTimeNot(tboiAddTime);this.put("tboiAddTimeNot", "not");this.put("tboiAddTime", tboiAddTime);return this;};
	 		
 		/** and tboi_add_time >= ? */
 		public M tboiAddTimeStart(Object start){if(proxy)return proxy().tboiAddTimeStart(start);this.put("tboiAddTimeStart", start);return this;};			
 		/** and tboi_add_time <= ? */
 		public M tboiAddTimeEnd(Object end){if(proxy)return proxy().tboiAddTimeEnd(end);this.put("tboiAddTimeEnd", end);return this;};
			
			
		
			
	 	
	 	public M add(String key, Object value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	 	public M add(F key, Object value) {if(proxy)return proxy().add(key,value);this.put(key.toString(), value);return this;}
	 	
	 	public M desc(C key) {if(proxy)return proxy().desc(key);this.put("desc", key.column);return this;}
	 	public M asc(C key) {if(proxy)return proxy().asc(key);this.put("asc", key.column);return this;}
	 	public M desc(String sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	 	public M asc(String sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	 	public M definex(String sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	 	
	 	/** 获取所有订单收益 **/
		public @api List<TbOrderInvoies> list(Integer size){			
			return getTbOrderInvoiesList(this,size);
		}
		/** 获取订单收益分页 **/
		public @api Page<TbOrderInvoies> page(Integer page,Integer size){			
			return getTbOrderInvoiesPage(page, size , this);
		}
		/** 根据查询条件取订单收益 **/
		public @api TbOrderInvoies get(){			
			return getTbOrderInvoies(this);
		}
		/** 获取订单收益数 **/
		public @api Long count(){			
			return getTbOrderInvoiesCount(this);
		}
		/** 获取订单收益表达式 **/
		public @api <T> T eval(String strEval){			
			return getTbOrderInvoiesEval(strEval,this);
		}
		
		/** 获取订单收益统计 **/
		public @api List<Map> stats(C sumKey,C groupKey,int dateType){			
			return getTbOrderInvoiesStats(this,sumKey,groupKey,dateType);
		}
		/** 获取订单收益统计 **/
		public @api List<Map> stats(C sumKey,C groupKey){			
			return getTbOrderInvoiesStats(this,sumKey,groupKey,-1);
		}
		
		/** 根据条件更新 **/
		public @api int update(){			
			M where = null;
			M set = null;
			if(this.type==0){
				if(this.linked==null)throw new RuntimeException("未发set");
				where = this;
				set = this.linked;
			}else{
				if(this.linked==null)throw new RuntimeException("未发where条件");
				set = this;
				where = this.linked;
			}
			return updateTbOrderInvoies(set,where);
		}
		/** 根据条件删除 **/
		public @api void delete(){			
			deleteTbOrderInvoies(this);
		}
	}
	
	public static class Param extends M{
		public Param(int type) {
			super(type);
		}
		public Param(int type, Boolean proxy) {
			super(type, proxy);
		}
	}
	
	/** 对象的字段描述 **/
	public static class F{
		
			
		/** 编号 [非空]       **/
		public final static @type(Long.class)  String tboiId="tboiId";
	 			
			
	 	
			
		/** 订单编号        **/
		public final static @type(String.class)  String tboiOrderNumber="tboiOrderNumber";
	 			
			
	 	
			
		/** 来源    1:直接购买 2:余额充值 3:代理购买 4:合伙人购买     **/
		public final static @type(Short.class)  String tboiSource="tboiSource";
	 			
			
	 	
			
		/** 所属品牌  [Merchant]      **/
		public final static @type(Long.class)  String tboiBrand="tboiBrand";
	 			
		/** and tboi_brand >= ? */
		public final static @type(Long.class) String tboiBrandMin="tboiBrandMin";
		/** and tboi_brand <= ? */
		public final static @type(Long.class) String tboiBrandMax="tboiBrandMax";
				
			
	 	
			
		/** 购买人  [Member]      **/
		public final static @type(Long.class)  String tboiBuyer="tboiBuyer";
	 			
			
	 	
			
		/** 订单总金额        **/
		public final static @type(Double.class)  String tboiTotal="tboiTotal";
	 			
		/** and tboi_total >= ? */
		public final static @type(Double.class) String tboiTotalMin="tboiTotalMin";
		/** and tboi_total <= ? */
		public final static @type(Double.class) String tboiTotalMax="tboiTotalMax";
				
			
	 	
			
		/** 实际支付金额        **/
		public final static @type(Double.class)  String tboiMoney="tboiMoney";
	 			
		/** and tboi_money >= ? */
		public final static @type(Double.class) String tboiMoneyMin="tboiMoneyMin";
		/** and tboi_money <= ? */
		public final static @type(Double.class) String tboiMoneyMax="tboiMoneyMax";
				
			
	 	
			
		/** 余额抵扣金额        **/
		public final static @type(Double.class)  String tboiProduct="tboiProduct";
	 			
		/** and tboi_product >= ? */
		public final static @type(Double.class) String tboiProductMin="tboiProductMin";
		/** and tboi_product <= ? */
		public final static @type(Double.class) String tboiProductMax="tboiProductMax";
				
			
	 	
			
		/** 优惠卷抵扣金额        **/
		public final static @type(Double.class)  String tboiCoupon="tboiCoupon";
	 			
		/** and tboi_coupon >= ? */
		public final static @type(Double.class) String tboiCouponMin="tboiCouponMin";
		/** and tboi_coupon <= ? */
		public final static @type(Double.class) String tboiCouponMax="tboiCouponMax";
				
			
	 	
			
		/** 平台收益        **/
		public final static @type(Double.class)  String tboiPtSy="tboiPtSy";
	 			
		/** and tboi_pt_sy >= ? */
		public final static @type(Double.class) String tboiPtSyMin="tboiPtSyMin";
		/** and tboi_pt_sy <= ? */
		public final static @type(Double.class) String tboiPtSyMax="tboiPtSyMax";
				
			
	 	
			
		/** 普通间接收益        **/
		public final static @type(Double.class)  String tboiPtJj="tboiPtJj";
	 			
		/** and tboi_pt_jj >= ? */
		public final static @type(Double.class) String tboiPtJjMin="tboiPtJjMin";
		/** and tboi_pt_jj <= ? */
		public final static @type(Double.class) String tboiPtJjMax="tboiPtJjMax";
				
			
	 	
			
		/** 普通直接收益        **/
		public final static @type(Double.class)  String tboiPtZj="tboiPtZj";
	 			
		/** and tboi_pt_zj >= ? */
		public final static @type(Double.class) String tboiPtZjMin="tboiPtZjMin";
		/** and tboi_pt_zj <= ? */
		public final static @type(Double.class) String tboiPtZjMax="tboiPtZjMax";
				
			
	 	
			
		/** 代理间接收益        **/
		public final static @type(Double.class)  String tboiDlJj="tboiDlJj";
	 			
		/** and tboi_dl_jj >= ? */
		public final static @type(Double.class) String tboiDlJjMin="tboiDlJjMin";
		/** and tboi_dl_jj <= ? */
		public final static @type(Double.class) String tboiDlJjMax="tboiDlJjMax";
				
			
	 	
			
		/** 代理直接收益        **/
		public final static @type(Double.class)  String tboiDlZj="tboiDlZj";
	 			
		/** and tboi_dl_zj >= ? */
		public final static @type(Double.class) String tboiDlZjMin="tboiDlZjMin";
		/** and tboi_dl_zj <= ? */
		public final static @type(Double.class) String tboiDlZjMax="tboiDlZjMax";
				
			
	 	
			
		/** 合伙人收益        **/
		public final static @type(Double.class)  String tboiHhrSy="tboiHhrSy";
	 			
		/** and tboi_hhr_sy >= ? */
		public final static @type(Double.class) String tboiHhrSyMin="tboiHhrSyMin";
		/** and tboi_hhr_sy <= ? */
		public final static @type(Double.class) String tboiHhrSyMax="tboiHhrSyMax";
				
			
	 	
			
		/** 配送商收益        **/
		public final static @type(Double.class)  String tboiPsSy="tboiPsSy";
	 			
		/** and tboi_ps_sy >= ? */
		public final static @type(Double.class) String tboiPsSyMin="tboiPsSyMin";
		/** and tboi_ps_sy <= ? */
		public final static @type(Double.class) String tboiPsSyMax="tboiPsSyMax";
				
			
	 	
			
		/** 经销商收益        **/
		public final static @type(Double.class)  String tboiJxsSy="tboiJxsSy";
	 			
		/** and tboi_jxs_sy >= ? */
		public final static @type(Double.class) String tboiJxsSyMin="tboiJxsSyMin";
		/** and tboi_jxs_sy <= ? */
		public final static @type(Double.class) String tboiJxsSyMax="tboiJxsSyMax";
				
			
	 	
			
		/** 剩余收益        **/
		public final static @type(Double.class)  String tboiSySy="tboiSySy";
	 			
		/** and tboi_sy_sy >= ? */
		public final static @type(Double.class) String tboiSySyMin="tboiSySyMin";
		/** and tboi_sy_sy <= ? */
		public final static @type(Double.class) String tboiSySyMax="tboiSySyMax";
				
			
	 	
			
		/** 添加时间        **/
		public final static @type(Date.class)  String tboiAddTime="tboiAddTime";
	 			
	 	/** and tboi_add_time >= ? */
 		public final static @type(Date.class) String tboiAddTimeStart="tboiAddTimeStart";
 		/** and tboi_add_time <= ? */
 		public final static @type(Date.class) String tboiAddTimeEnd="tboiAddTimeEnd";
				
			
	 	
	 	public static String get(String name){
			try {
				Field field = F.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	/** 对象的数据库字段描述 **/
	public static enum C{
		
		tboiId("tboi_id"),
		tboiOrderNumber("tboi_order_number"),
		tboiSource("tboi_source"),
		tboiBrand("tboi_brand"),
		tboiBuyer("tboi_buyer"),
		tboiTotal("tboi_total"),
		tboiMoney("tboi_money"),
		tboiProduct("tboi_product"),
		tboiCoupon("tboi_coupon"),
		tboiPtSy("tboi_pt_sy"),
		tboiPtJj("tboi_pt_jj"),
		tboiPtZj("tboi_pt_zj"),
		tboiDlJj("tboi_dl_jj"),
		tboiDlZj("tboi_dl_zj"),
		tboiHhrSy("tboi_hhr_sy"),
		tboiPsSy("tboi_ps_sy"),
		tboiJxsSy("tboi_jxs_sy"),
		tboiSySy("tboi_sy_sy"),
		tboiAddTime("tboi_add_time"),
		count("count");
		String column;
		C(String column){
			this.column = column;
		}
		public String toString(){
			return this.column;
		}
		public static String get(String name){
			try {
				Field field = C.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	
	/**
	* 获取订单收益数据
	**/
	public static Object getData(Object param){
		if(param==null)
			return null;
		Object value = null;
		if(param.getClass()==Long.class)
			value = TbOrderInvoies.get((Long)param);
		else if(param instanceof java.util.Map){
			java.util.Map params = (Map) param;
			if(params.get("size")==null)
				value = TbOrderInvoies.getTbOrderInvoies(params);
			else
				value = TbOrderInvoies.getTbOrderInvoiesList(params, (Integer) params.get("size"));
		}else if(param.getClass()==Long.class )
			value =  TbOrderInvoies.where().tboiId(param).get();
		else if(!Utils.empty(param.toString()))
			value = TbOrderInvoies.get(Long.valueOf(param.toString()));
		return value;
	}
	
	/**对象转json**/
	public Map toJSON(){
		return toJSON(false);
	}
	public Map toJSON(boolean simple){
		return toJSON(simple,0);
	}
	public Map toJSON(boolean simple,int step){
		Map map = new HashMap();
		map.put("id",this.getTboiId());
	
		Utils.fms(map,simple?"id":"tboiId",this.getTboiId(),this.getTboiId$());
		
			
 		
	
		Utils.fms(map,simple?"orderNumber":"tboiOrderNumber",this.getTboiOrderNumber(),this.getTboiOrderNumber$());
		
			
 		
	
		Utils.fms(map,simple?"source":"tboiSource",this.getTboiSource(),this.getTboiSource$());
		
			
 		
	
		Utils.fms(map,simple?"brand":"tboiBrand",this.getTboiBrand(),this.getTboiBrand$());
		
			
 		
	
		Utils.fms(map,simple?"buyer":"tboiBuyer",this.getTboiBuyer(),this.getTboiBuyer$());
		
			
 		
	
		Utils.fms(map,simple?"total":"tboiTotal",this.getTboiTotal(),this.getTboiTotal$());
		
			
 		
	
		Utils.fms(map,simple?"money":"tboiMoney",this.getTboiMoney(),this.getTboiMoney$());
		
			
 		
	
		Utils.fms(map,simple?"product":"tboiProduct",this.getTboiProduct(),this.getTboiProduct$());
		
			
 		
	
		Utils.fms(map,simple?"coupon":"tboiCoupon",this.getTboiCoupon(),this.getTboiCoupon$());
		
			
 		
	
		Utils.fms(map,simple?"ptSy":"tboiPtSy",this.getTboiPtSy(),this.getTboiPtSy$());
		
			
 		
	
		Utils.fms(map,simple?"ptJj":"tboiPtJj",this.getTboiPtJj(),this.getTboiPtJj$());
		
			
 		
	
		Utils.fms(map,simple?"ptZj":"tboiPtZj",this.getTboiPtZj(),this.getTboiPtZj$());
		
			
 		
	
		Utils.fms(map,simple?"dlJj":"tboiDlJj",this.getTboiDlJj(),this.getTboiDlJj$());
		
			
 		
	
		Utils.fms(map,simple?"dlZj":"tboiDlZj",this.getTboiDlZj(),this.getTboiDlZj$());
		
			
 		
	
		Utils.fms(map,simple?"hhrSy":"tboiHhrSy",this.getTboiHhrSy(),this.getTboiHhrSy$());
		
			
 		
	
		Utils.fms(map,simple?"psSy":"tboiPsSy",this.getTboiPsSy(),this.getTboiPsSy$());
		
			
 		
	
		Utils.fms(map,simple?"jxsSy":"tboiJxsSy",this.getTboiJxsSy(),this.getTboiJxsSy$());
		
			
 		
	
		Utils.fms(map,simple?"sySy":"tboiSySy",this.getTboiSySy(),this.getTboiSySy$());
		
			
 		
	
		Utils.fms(map,simple?"addTime":"tboiAddTime",this.getTboiAddTime(),this.getTboiAddTime$());
		
		map.put("atime",this.getTboiAddTime$());map.put("ctime",this.getTboiAddTime$());
		
			
 		
	
		if(this.suffix!=null)map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOJSON************/
		/************LAZY3Q_DEFINE_TOJSON************/
		return map;
	}
	/**对象转map**/
	public Map toMap(){
		Map map = new HashMap();
	
		map.put("tboiId",this.getTboiId());
 		
	
		map.put("tboiOrderNumber",this.getTboiOrderNumber());
 		
	
		map.put("tboiSource",this.getTboiSource());
 		
	
		map.put("tboiBrand",this.getTboiBrand());
 		
	
		map.put("tboiBuyer",this.getTboiBuyer());
 		
	
		map.put("tboiTotal",this.getTboiTotal());
 		
	
		map.put("tboiMoney",this.getTboiMoney());
 		
	
		map.put("tboiProduct",this.getTboiProduct());
 		
	
		map.put("tboiCoupon",this.getTboiCoupon());
 		
	
		map.put("tboiPtSy",this.getTboiPtSy());
 		
	
		map.put("tboiPtJj",this.getTboiPtJj());
 		
	
		map.put("tboiPtZj",this.getTboiPtZj());
 		
	
		map.put("tboiDlJj",this.getTboiDlJj());
 		
	
		map.put("tboiDlZj",this.getTboiDlZj());
 		
	
		map.put("tboiHhrSy",this.getTboiHhrSy());
 		
	
		map.put("tboiPsSy",this.getTboiPsSy());
 		
	
		map.put("tboiJxsSy",this.getTboiJxsSy());
 		
	
		map.put("tboiSySy",this.getTboiSySy());
 		
	
		map.put("tboiAddTime",this.getTboiAddTime());
 		
	
		map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOMAP************/
		/************LAZY3Q_DEFINE_TOMAP************/
		return map;
	}
	/**map转对象**/
	public static TbOrderInvoies fromMap(Map map){
		TbOrderInvoies tbOrderInvoies = new TbOrderInvoies();
	
		tbOrderInvoies.tboiId = Utils.parseLong(map.get("tboiId"));
 		
	
		tbOrderInvoies.tboiOrderNumber = Utils.parseString(map.get("tboiOrderNumber"));
 		
	
		tbOrderInvoies.tboiSource = Utils.parseShort(map.get("tboiSource"));
 		
	
		tbOrderInvoies.tboiBrand = Utils.parseLong(map.get("tboiBrand"));
 		
	
		tbOrderInvoies.tboiBuyer = Utils.parseLong(map.get("tboiBuyer"));
 		
	
		tbOrderInvoies.tboiTotal = Utils.parseDouble(map.get("tboiTotal"));
 		
	
		tbOrderInvoies.tboiMoney = Utils.parseDouble(map.get("tboiMoney"));
 		
	
		tbOrderInvoies.tboiProduct = Utils.parseDouble(map.get("tboiProduct"));
 		
	
		tbOrderInvoies.tboiCoupon = Utils.parseDouble(map.get("tboiCoupon"));
 		
	
		tbOrderInvoies.tboiPtSy = Utils.parseDouble(map.get("tboiPtSy"));
 		
	
		tbOrderInvoies.tboiPtJj = Utils.parseDouble(map.get("tboiPtJj"));
 		
	
		tbOrderInvoies.tboiPtZj = Utils.parseDouble(map.get("tboiPtZj"));
 		
	
		tbOrderInvoies.tboiDlJj = Utils.parseDouble(map.get("tboiDlJj"));
 		
	
		tbOrderInvoies.tboiDlZj = Utils.parseDouble(map.get("tboiDlZj"));
 		
	
		tbOrderInvoies.tboiHhrSy = Utils.parseDouble(map.get("tboiHhrSy"));
 		
	
		tbOrderInvoies.tboiPsSy = Utils.parseDouble(map.get("tboiPsSy"));
 		
	
		tbOrderInvoies.tboiJxsSy = Utils.parseDouble(map.get("tboiJxsSy"));
 		
	
		tbOrderInvoies.tboiSySy = Utils.parseDouble(map.get("tboiSySy"));
 		
	
		tbOrderInvoies.tboiAddTime = Utils.parseDate(map.get("tboiAddTime"));
 		
	
		return tbOrderInvoies;
	}
	
	
	/**字段设置标记队列**/
	private Map<String,Boolean> seted=new HashMap();
	public Boolean getSeted(String key){
		return seted.get(key);
	}
	public void setSeted(String key){
		seted.put(key,true);
	}
	/**同步未set的字段**/
	public void mergeSet(TbOrderInvoies old){
		Field[] fields = this.getClass().getDeclaredFields();
		try {
			for(Field field:fields){
				String key = field.getName();
				if(seted.get(key)==null && field.getAnnotation(column.class)!=null){
					field.setAccessible(true);
					field.set(this, field.get(old));					
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
		
	/**自定义变量存储**/
	private Map values=new HashMap();
	public Map getValues(){
		return values;
	}
	public void setValues(String name,Object value){
		values.put(name,value);
	}
	
	/**分表时的表名后缀**/
	private String suffix;
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	
	
	/**获取数据库名称**/
	public static String getDataBaseName(){
		return Utils.config("spring.datasource.distribute_sys.name");
	}
	
	
	public static String getIcon(){
		return "/images/icons/1086174465.png";
	}
	public static String getIconfont(){
		return "icon-xiaoshou";
	}
	public static enum ACT{
		列表,添加,修改,详情
	};
	public static String getUrl(ACT act,TbOrderInvoies.M params){
		if(params==null)params=new TbOrderInvoies.M(0);
		params.remove("joins");
		params.remove("definexs");
		params.remove("distinct");
		String strUrl = "/admin/goods/tborderinvoies.edit.html?";
		if(params.get("tboiId")!=null){
			strUrl+="&id="+Utils.encode(""+params.get("tboiId"),Utils.UTF8);
		}
		if(act==ACT.列表){
			strUrl = "/admin/goods/tborderinvoies.html?1=1";
		
		}else if(act==ACT.添加){
			strUrl+="&edittype=insert";
		
		
		}else if(act==ACT.修改){
			strUrl+="&edittype=update";
		
		}else if(act==ACT.详情){
			strUrl+="&edittype=detail";
		
		}		
		if(params!=null){
			for(Object key:params.keySet()){
				strUrl+="&"+key+"="+Utils.encode(""+params.get(key),Utils.UTF8)+"";
			}
		}
		return strUrl;
	}
	public String getDetailUrl(){
		return this.getUrl(ACT.详情, where.tboiId(this.getId()));
	}
	
	/**
	* 转跳到当前地址
	**/
	public static Protocol redirect(TbOrderInvoies.ACT act,TbOrderInvoies.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_REDIRECT");
		protocol.set("url",TbOrderInvoies.getUrl(act, params));
		return protocol;
	}
	/**
	* 打开一个新的tab页面
	**/
	public static Protocol href(TbOrderInvoies.ACT act,TbOrderInvoies.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_HREF");
		protocol.set("url",TbOrderInvoies.getUrl(act, params));
		protocol.set("title",act.name());
		return protocol;
	}
	/**
	* 显示一个消息框，并且关闭当前的对话框
	**/
	public static Protocol message(String message){
		Protocol protocol = Protocol.create(true,null,"ACT_MESSAGE");
		protocol.set("message",message);
		return protocol;
	}
	
	
	static com.distribute.framework.dao.ITbOrderInvoiesDao getTbOrderInvoiesDao(){
		return Utils.getBean("tbOrderInvoiesDao");
	};
	
}